load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
load("//pkg/testutils:buildutil/buildutil.bzl", "disallowed_imports_test")

go_library(
    name = "colexecutils",
    srcs = [
        "bool_vec_to_sel.go",
        "cancel_checker.go",
        "deselector.go",
        "deserializer.go",
        "operator.go",
        "overloads_bin_util.go",
        "spilling_buffer.go",
        "spilling_queue.go",
        "utils.go",
    ],
    importpath = "github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecutils",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/col/coldata",
        "//pkg/col/colserde",
        "//pkg/roachpb",
        "//pkg/sql/colcontainer",
        "//pkg/sql/colexecerror",
        "//pkg/sql/colexecop",
        "//pkg/sql/colmem",
        "//pkg/sql/execinfrapb",
        "//pkg/sql/sem/eval",
        "//pkg/sql/sem/tree",
        "//pkg/sql/sqlerrors",
        "//pkg/sql/types",
        "//pkg/util/cancelchecker",
        "//pkg/util/log",
        "//pkg/util/metamorphic",
        "//pkg/util/mon",
        "@com_github_apache_arrow_go_arrow//array",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_marusama_semaphore//:semaphore",
    ],
)

go_test(
    name = "colexecutils_test",
    srcs = [
        "bool_vec_to_sel_test.go",
        "cancel_checker_test.go",
        "deselector_test.go",
        "main_test.go",
        "spilling_buffer_test.go",
        "spilling_queue_test.go",
    ],
    embed = [":colexecutils"],
    deps = [
        "//pkg/col/coldata",
        "//pkg/col/coldataext",
        "//pkg/col/coldatatestutils",
        "//pkg/settings/cluster",
        "//pkg/sql/colcontainer",
        "//pkg/sql/colexec/colexectestutils",
        "//pkg/sql/colexecerror",
        "//pkg/sql/colexecop",
        "//pkg/sql/colmem",
        "//pkg/sql/execinfra",
        "//pkg/sql/randgen",
        "//pkg/sql/sem/eval",
        "//pkg/sql/types",
        "//pkg/testutils/colcontainerutils",
        "//pkg/testutils/skip",
        "//pkg/util/cancelchecker",
        "//pkg/util/humanizeutil",
        "//pkg/util/leaktest",
        "//pkg/util/log",
        "//pkg/util/mon",
        "//pkg/util/randutil",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_stretchr_testify//require",
    ],
)

disallowed_imports_test(
    "colexecutils",
    disallowed_prefixes = [
        "pkg/sql/colexec/",
    ],
)
